Skip to content

feat: modern event subsystem - #1945

Open
mdjastrzebski wants to merge 5 commits into
mainfrom
next/event-system
Open

mdjastrzebski wants to merge 5 commits into
mainfrom
next/event-system

Conversation

@mdjastrzebski

@mdjastrzebski mdjastrzebski commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Merges the next/event-system feature branch (#1944, #1946) into main.

Adds an 'modern' event system for fireEvent and userEvent, opt-in with configure({ unstable_eventSystem: 'modern' }). It follows React Native's event dispatch: handlers receive a SyntheticEvent, and events bubble or go direct like on a device.

  • Adds modern fireEvent, including fireEvent.press(), which calls the press callback of the element that becomes the touch responder (Pressable, Touchable*).
  • Aligns modern userEvent.press() / longPress() with it, so both press the same element.
  • 'legacy' stays the default and behaves as before. Its code moves to src/events/legacy/, with code used by both systems in src/events/shared/.
  • Jest runs every test in both event systems (legacy and modern projects) against shared snapshots.

Test plan

  • yarn validate (typecheck, tests in both Jest projects, lint, format check): 184 suites, 2278 tests, 518 snapshots passed.

if (Object.hasOwn(target, key) && isObject(sourceValue) && isObject(targetValue)) {
mergeInto(targetValue, sourceValue);
} else {
target[key] = sourceValue;
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.93%. Comparing base (5678d04) to head (59af3ee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1945      +/-   ##
==========================================
+ Coverage   98.56%   98.93%   +0.36%     
==========================================
  Files          87      103      +16     
  Lines        1744     2254     +510     
  Branches      459      597     +138     
==========================================
+ Hits         1719     2230     +511     
+ Misses         24       23       -1     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mdjastrzebski
mdjastrzebski marked this pull request as ready for review October 13, 2026 20:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants